package com.sc.nft.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.WorkCityServerAssessLog;
import com.sc.nft.entity.dto.AssessLogAdminPageDTO;
import com.sc.nft.entity.dto.AssessLogAdminPageVO;
import com.sc.nft.mapper.WorkCityServerAssessLogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

/**
 * 考核记录表(WorkCityServerAssessLog)表Dao层
 *
 * @author 王伟成
 * @since 2024-04-09 20:35:19
 */
@Slf4j
@Repository
public class WorkCityServerAssessLogDao extends ServiceImpl<WorkCityServerAssessLogMapper, WorkCityServerAssessLog> {

    public Boolean communityNetworkAssessment(WorkCityServerAssessLog workCityServerAssessLog) {
        LambdaUpdateWrapper<WorkCityServerAssessLog> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
        lambdaUpdateWrapper.eq(WorkCityServerAssessLog::getId, workCityServerAssessLog.getId());
        workCityServerAssessLog.setId(null);
        return update(workCityServerAssessLog, lambdaUpdateWrapper);

    }
    public Page<AssessLogAdminPageVO> assessPage(AssessLogAdminPageDTO assessLogAdminPageDTO) {
        return baseMapper.assessPage(assessLogAdminPageDTO.toMp(), assessLogAdminPageDTO.getStartTime(), assessLogAdminPageDTO.getEndTime(), assessLogAdminPageDTO.getType());
    }
}
